﻿@model IEnumerable<Project.Domain.Entities.Bet>
 @{
     var matchid = 0;
     var count = 0;
     matchid = Convert.ToInt32(ViewBag.matchid);
 }

<div class="courseList" style="display: none;">
	@foreach (var userbet in (IEnumerable < Project.Domain.Entities.User >) ViewBag.Userbets)
	{
	<div class="userbet">
		<text style="color:#808080 !important;">UserName:</text>&nbsp;@userbet.UserName
	</div>
        <div class="wrap">
            @if (Model.Count(b=>b.UserId==userbet.UserId && b.Type==1)>0)
            {
                <div class="course listbetExactScore" >
                    <div class="listbetExactScore_title">3Way</div>
                    @foreach (var betItem in Model)
                    {
                        if (betItem.UserId == userbet.UserId)
                        {
                            if (betItem.Type == 1)
                            {
                                Html.RenderAction("GetBetDetails", "Sport", new {betid = betItem.BetId, userid = userbet.UserId});
                            }
                        }
                    }
                </div>
            }
            @if (Model.Count(b => b.UserId == userbet.UserId && b.Type == 2) > 0)
            {
                <div class="course listbetExactScore" >
                    <div class="listbetExactScore_title">Handicap</div>
                    @foreach (var betItem in Model.Where(b => b.Type == 2))
                    {
                        if (betItem.UserId == userbet.UserId)
                        {
                            if (betItem.Type == 2)
                            {
                                Html.RenderAction("GetBetDetails", "Sport", new {betid = betItem.BetId, userid = userbet.UserId});
                            }
                        }
                    }
                </div>
            }
            @if (Model.Count(b => b.UserId == userbet.UserId && b.Type == 3) > 0)
            {
                <div class="course listbetExactScore" >
                    <div class="listbetExactScore_title">Asian Handicap</div>
                    @foreach (var betItem in Model.Where(b => b.Type == 3))
                    {
                        if (betItem.UserId == userbet.UserId)
                        {
                            if (betItem.Type == 3)
                            {
                                Html.RenderAction("GetBetDetails", "Sport", new {betid = betItem.BetId, userid = userbet.UserId});
                            }
                        }
                    }
                </div>
            }
            @if (Model.Count(b => b.UserId == userbet.UserId && b.Type == 4) > 0)
            {
                <div class="course listbetExactScore" >
                    <div class="listbetExactScore_title">Under/Over</div>
                    @foreach (var betItem in Model.Where(b => b.Type == 4))
                    {
                        if (betItem.UserId == userbet.UserId)
                        {
                            if (betItem.Type == 4)
                            {
                                Html.RenderAction("GetbetUnderOver", "Sport", new {betid = betItem.BetId, userid = userbet.UserId});
                            }
                        }
                    }
                </div>
            }
            @if (Model.Count(b => b.UserId == userbet.UserId && b.Type == 5) > 0)
            {
                <div class="course listbetExactScore">
                    <div class="listbetExactScore_title">Exact Score</div>
                    @{ Html.RenderAction("GetbetExactScore", "sport", new {matchid = matchid, userid = userbet.UserId}); }            
                </div>
            }
        </div>     
	}
</div>  